const COLUMN_LIST = [
  {
    label: '供应商名称',
    prop: 'supplierNames'
  },
  {
    label: '情况记录',
    prop: 'comment'
  },
  {
    label: '操作步骤',
    prop: 'stepName'
  },
  {
    label: '评审项目节点',
    prop: 'itemName'
  }
]
const FILTER_FORM_ITEM = [
  {
    key: 'supplierName',
    value: '',
    name: '供应商名称',
    formType: 'input',
    verificationData: '',
    elementConfig: {
      textareaWidth: '400px'
    }
  }
]
const ADD_FORM_ITEM = [
  {
    key: 'supplierIds',
    value: '',
    name: '供应商名称',
    formType: 'select',
    verificationData: '必填',
    elementConfig: {
      options: [],
      textareaWidth: '550px'
    }
  },
  {
    key: 'stepCode',
    value: '',
    name: '操作步骤',
    formType: 'select',
    verificationData: '必填',
    elementConfig: {
      options: [],
      textareaWidth: '550px'
    }
  },
  {
    key: 'itemId',
    value: '',
    name: '评审项目节点',
    formType: 'select',
    verificationData: '必填',
    elementConfig: {
      options: [],
      textareaWidth: '550px'
    }
  },
  {
    key: 'comment',
    value: '',
    name: '情况记录',
    formType: 'textarea',
    verificationData: '',
    elementConfig: {
      rows: 3,
      textareaWidth: '1130px'
    }
  }
]

const getItemName = (options: any, key: string) => {
  const item = options.find((item: any) => item.key === key)
  return item ? item.value : ''
}

const getSupplierNames = (options: any, ids: any[]) => {
  const arr = options.find((item: any) => item.key == ids)
  return arr.value
}

export { COLUMN_LIST, FILTER_FORM_ITEM, ADD_FORM_ITEM, getItemName, getSupplierNames }
